import services from '@/services';
const state = {
  countryList: [], //国家列表
  searchText: "", //搜索内容
  shareList: [{
    methods: "facebook",
    url: "https://www.facebook.com/dialog/share?app_id=1082624138815853&display=popup", //分享到的地址
    img: require("@/assets/imgs/share-1.png"),
  }, {
    methods: "facebook",
    url: "https://www.facebook.com/dialog/share?app_id=1082624138815853&display=popup", //分享到的地址
    img: require("@/assets/imgs/share-2.png"),
  }, {
    methods: "facebook",
    url: "https://www.facebook.com/dialog/share?app_id=1082624138815853&display=popup", //分享到的地址
    img: require("@/assets/imgs/share-3.png"),
  }, {
    methods: "facebook",
    url: "https://www.facebook.com/dialog/share?app_id=1082624138815853&display=popup", //分享到的地址
    img: require("@/assets/imgs/share-4.png"),
  }, {
    methods: "facebook",
    url: "https://www.facebook.com/dialog/share?app_id=1082624138815853&display=popup", //分享到的地址
    img: require("@/assets/imgs/share-5.png"),
  }], //分享列表
  basicUrl: "", //记录当前URL,路由拦截器里面写入，//plugins/router
}

const mutations = {
  setCountryList(state, data) {
    state.countryList = data;
  },
  setSearchText(state, data) {
    state.searchText = data;
  },
  setBasicUrl(state, data) {
    state.basicUrl = data;
  }
}

const actions = {
  //国家列表
  async cotuntryList(store, params) {
    const {
      data
    } = await services.over.cotuntryList(params);
    return data;
  },
  //获取自由块
  async freeblock(store, params) {
    const {
      data
    } = await services.over.freeblock(params);
    return data;
  },
  //获取广告位
  async adverts(store, params) {
    const {
      data
    } = await services.over.adverts(params);
    return data;
  },
  //邮箱订阅
  async subscribe(store, params) {
    const {
      data
    } = await services.over.subscribe(params);
    return data;
  },
}

const getters = {

}

export default {
  namespaced: true,
  state,
  mutations,
  actions,
}
